#ifndef FileReader_h__
#define FileReader_h__

#include "Path.h"

#include <cstdio>

namespace le
{
	enum EFileReadType
	{
		eFileReadType_Buffer, // Reads the full file directly to a buffer, ready to use
		// eFileReadType_OnDemand, // You are required to read the parts of the file when you want it to
	};

	class FileReader
	{
	public:
		FileReader(const le::Path& filePath, le::EFileReadType fileReadType);
		virtual ~FileReader();

		bool IsOpened() const {return m_FileOpened;}

		FILE* GetFilePointer() const {return m_FilePointer;}
		size_t GetFileSize() const {return m_FileSize;}
		EFileReadType GetFileReadType() const {return m_FileReadType;}

		const char* GetFileBuffer() const {return m_FileBuffer;}

	private:
		size_t m_FileSize;
		FILE* m_FilePointer;
		bool m_FileOpened;
		le::Path m_FilePath;
		le::EFileReadType m_FileReadType;
		char* m_FileBuffer;
	};
}

#endif // FileReader_h__